//SPDX-FileCopyrightText: Copyright 2022-2024 深圳市同心圆网络有限公司
//SPDX-License-Identifier: GPL-3.0-only

package api_coll_dao

import "go.mongodb.org/mongo-driver/mongo"

var InfoDao *_InfoDao
var GrpcExtraDao *_GrpcExtraDao
var OpenApiExtraDao *_OpenApiExtraDao
var CustomExtraDao *_CustomExtraDao
var ApiGroupDao *_ApiGroupDao
var ApiItemDao *_ApiItemDao

func InitDao(mgoDb *mongo.Database) (err error) {
	InfoDao, err = newInfoDao(mgoDb)
	if err != nil {
		return
	}
	GrpcExtraDao, err = newGrpcExtraDao(mgoDb)
	if err != nil {
		return
	}
	OpenApiExtraDao, err = newOpenApiExtraDao(mgoDb)
	if err != nil {
		return
	}
	CustomExtraDao, err = newCustomExtraDao(mgoDb)
	if err != nil {
		return
	}
	ApiGroupDao, err = newApiGroupDao(mgoDb)
	if err != nil {
		return
	}
	ApiItemDao, err = newApiItemDao(mgoDb)
	if err != nil {
		return
	}
	return
}
